package com.augurit.common.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;


/**
 * 字段结构元数据定义类
 *
 */

@Entity
@Table(name="SYS_META_COLUMN")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class SysMetaColumn {
	private Long id;
	private Long tableId;			//关联表结构id
	private String columnName;		//字段名
	private String columnComments;	//字段注释
	private String columnType;		//字段类型
	private Long columnLength;		//字段长度
	private Long columnPrecision;	//字段精度
	private Long columnScale;		//字段小数位
	private String nullable;		//是否可以为空
	private String isPrimaryKey;	//是否为主要键
	private String memo;			//描述
	private String propertyName;
	private String fieldId;					//字段ID
	private String defaultValue;			//默认值
	private String dictionary;				//数据字典
	private String refTable;				//外键引用表名
	private String refColumn;				//外键引用列名
	private String isUnique;				//是否需要创建唯一键约束
	private String isIndex;					//是否索引字段
	private String sqlType;					//sql类型
	private String isForeignKey;			//是否为外键
	
	@Id
	@SequenceGenerator(name="SEQ_SYS_META_COLUMN",sequenceName="SEQ_SYS_META_COLUMN",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SEQ_SYS_META_COLUMN")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Long getTableId() {
		return tableId;
	}
	public void setTableId(Long tableId) {
		this.tableId = tableId;
	}
	public String getColumnName() {
		return columnName;
	}
	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}
	public String getColumnComments() {
		return columnComments;
	}
	public void setColumnComments(String columnComments) {
		this.columnComments = columnComments;
	}
	public String getColumnType() {
		return columnType;
	}
	public void setColumnType(String columnType) {
		this.columnType = columnType;
	}
	public Long getColumnLength() {
		return columnLength;
	}
	public void setColumnLength(Long columnLength) {
		this.columnLength = columnLength;
	}
	public Long getColumnPrecision() {
		return columnPrecision;
	}
	public void setColumnPrecision(Long columnPrecision) {
		this.columnPrecision = columnPrecision;
	}
	public Long getColumnScale() {
		return columnScale;
	}
	public void setColumnScale(Long columnScale) {
		this.columnScale = columnScale;
	}
	public String getNullable() {
		return nullable;
	}
	public void setNullable(String nullable) {
		this.nullable = nullable;
	}
	public String getIsPrimaryKey() {
		return isPrimaryKey;
	}
	public void setIsPrimaryKey(String isPrimaryKey) {
		this.isPrimaryKey = isPrimaryKey;
	}
	public String getMemo() {
		return memo;
	}
	public void setMemo(String memo) {
		this.memo = memo;
	}
	public String getPropertyName() {
		return propertyName;
	}
	public void setPropertyName(String propertyName) {
		this.propertyName = propertyName;
	}
	public String getFieldId() {
		return fieldId;
	}
	public void setFieldId(String fieldId) {
		this.fieldId = fieldId;
	}
	public String getDefaultValue() {
		return defaultValue;
	}
	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}
	public String getDictionary() {
		return dictionary;
	}
	public void setDictionary(String dictionary) {
		this.dictionary = dictionary;
	}
	public String getRefTable() {
		return refTable;
	}
	public void setRefTable(String refTable) {
		this.refTable = refTable;
	}
	public String getRefColumn() {
		return refColumn;
	}
	public void setRefColumn(String refColumn) {
		this.refColumn = refColumn;
	}
	public String getIsUnique() {
		return isUnique;
	}
	public void setIsUnique(String isUnique) {
		this.isUnique = isUnique;
	}
	public String getIsIndex() {
		return isIndex;
	}
	public void setIsIndex(String isIndex) {
		this.isIndex = isIndex;
	}
	public String getSqlType() {
		return sqlType;
	}
	public void setSqlType(String sqlType) {
		this.sqlType = sqlType;
	}
	public String getIsForeignKey() {
		return isForeignKey;
	}
	public void setIsForeignKey(String isForeignKey) {
		this.isForeignKey = isForeignKey;
	}
}
